package main

import (
	"fmt"
)

func main() {
	// 通过make定义切片
	slice := make([]int, 4, 20)
	fmt.Println("slice: ", slice)
	fmt.Println("slice长度: ", len(slice))
	fmt.Println("slice容量: ", cap(slice))

	slice[0] = 1
	slice[2] = 2
	fmt.Println("slice: ", slice)
}